/* hc256.h
** 
** Copyright (c) 2007, Matt Hamrick, Siobhan Murtagh & Damon Orecks
** All rights reserved.
** 
** Redistribution  and  use  in  source  and  binary  forms,  with  or  without
** modification, are permitted provided that the following conditions are met:
** 
**  * Redistributions of  source code must  retain the above  copyright notice,
**    this list of conditions and the following disclaimer.
** 
**  * Redistributions in binary form must reproduce the above copyright notice,
**    this list of conditions and the following disclaimer in the documentation
**    and/or other materials provided with the distribution.
** 
**  * Neither  the  name  of the  DangerThink  Project  nor  the names  of  its
**    contributors may be used to endorse or promote products derived from this
**    software without specific prior written permission.
** 
** THIS SOFTWARE IS PROVIDED BY  THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
** AND ANY  EXPRESS OR IMPLIED WARRANTIES,  INCLUDING, BUT NOT  LIMITED TO, THE
** IMPLIED WARRANTIES  OF MERCHANTABILITY AND FITNESS FOR  A PARTICULAR PURPOSE
** ARE DISCLAIMED.  IN NO  EVENT SHALL THE  COPYRIGHT OWNER OR  CONTRIBUTORS BE
** LIABLE  FOR  ANY  DIRECT,   INDIRECT,  INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR
** CONSEQUENTIAL  DAMAGES  (INCLUDING,  BUT  NOT  LIMITED  TO,  PROCUREMENT  OF
** SUBSTITUTE GOODS  OR SERVICES;  LOSS OF USE,  DATA, OR PROFITS;  OR BUSINESS
** INTERRUPTION)  HOWEVER CAUSED  AND ON  ANY THEORY  OF LIABILITY,  WHETHER IN
** CONTRACT,  STRICT LIABILITY,  OR  TORT (INCLUDING  NEGLIGENCE OR  OTHERWISE)
** ARISING IN ANY WAY  OUT OF THE USE OF THIS SOFTWARE,  EVEN IF ADVISED OF THE
** POSSIBILITY OF SUCH DAMAGE.
**
** $Id: portable.h 21 2007-05-14 22:57:09Z msh.mobile $
*/

/* This file includes a number of other standard system includes like stddef.h,
** stdint.h, config.h, etc. We use the autoconf tools to automatically generate
** makefiles and the config.h file. In theory, you're supposed to check various
** macro definitions in each .c file before you include headers, but this gets
** a little tedious. So we moved all that into this header file. So if you look
** at the various .c files, you'll see that they all include this file, and then
** they include package-specific headers.
**
** So, if you're adding a new function to the DangerThink Crypto library, you
** should follow the same pattern.
*/

/* Macro Definitions */
#ifndef _H_PORTABLE
#define _H_PORTABLE

/* File Includes */
#ifdef HAVE_CONFIG_H
#include "config.h"
#else
#error __FILE__ requires a valid config.h header file.
#endif /* HAVE_CONFIG_H */

#ifdef malloc
#undef malloc
#endif

#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#else
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#else
#error __FILE__ requires the arpa/inet.h header file.
#endif /* HAVE_WINSOCK2_H */
#endif /* HAVE_ARPA_INET_H */

#ifdef HAVE_STRING_H
#include <string.h>
#else
#ifdef HAVE_STRINGS_H
#include <strings.h>
#else
#error __FILE__ requires either a string.h or strings.h head file.
#endif /* HAVE_STRINGS_H */
#endif /* HAVE_STRING_H */

#ifdef HAVE_STDLIB_H
#include "stdlib.h"
#else
#error __FILE__ requires the stdlib.h header file.
#endif /* HAVE_STDLIB_H */

#ifdef HAVE_STDINT_H
#include "stdint.h"
#else
#ifdef HAVE_INTTYPES_H
#include "inttypes.h"
#else
#ifdef WINCE
#include "winceint.h"
#else
#error __FILE__ requires stdint.h or inttypes.h header file.
#endif /* UNDER_CE */
#endif /* HAVE_INTTYPES_H */
#endif /* HAVE_STDINT_H */

#endif /* _H_PORTABLE */
